package com.hcss;
import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.Properties;

@EnableScheduling
@EnableTransactionManagement //全局事务
@SpringBootApplication
@MapperScan("com.hcss.**.dao")
@ServletComponentScan
@EnableSwagger2
public class AthenaApplication {
	
	/**
	 * 入口启动函数
	 * @param args
	 */
	public static void main(String[] args) {
		SpringApplication.run(AthenaApplication.class, args);
	}
	@Bean
	public DatabaseIdProvider getDatabaseIdProvider(){
		DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
		Properties properties = new Properties();
		properties.setProperty("Oracle","oracle");
		properties.setProperty("MySQL","mysql");
		databaseIdProvider.setProperties(properties);
		return databaseIdProvider;
	}



}
